<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <?php if (isset($page_title)): ?>
            <title><?php echo $page_title; ?></title>
        <?php else: ?>
            <title>After Idea</title>
        <?php endif; ?>
        <meta http-equiv="content-type" content="text/html;charset=utf-8" />
        <link rel="stylesheet" type="text/css" href="<?php echo base_url(); ?>script/css/reset.css" />
        <?php
        if (isset($css)) {
            foreach ($css as $value) {
                ?>
                <link rel="stylesheet" href="<?php echo base_url(); ?>script/css/<?php echo $value; ?>.css" />
                <?php
            }
        }
        ?>
        <script type="text/javascript">
            var base_url = "<?php echo base_url(); ?>";
        </script>
        <script type="text/javascript" src="<?php echo base_url(); ?>script/js/jquery.min.js"></script>
        <?php
        if (isset($js)) {
            foreach ($js as $value) {
                ?>
                <script type="text/javascript" src="<?php echo base_url(); ?>script/js/<?php echo $value; ?>.js"></script>
                <?php
            }
        }
        ?>
    </head>
    <body>
        <div id="main-container">
            <div id="header">
                <div id="header-top">
                    <h1 id="site-title">THIS SITE IS RUNNING IN BETA-TEST NOW >></h1>
                    <div id="cart-wrap">
                        <img id="cart-icon" src="<?php echo base_url();?>images/cart-icon.png"/>
                        <div id="cart-box">
                            <div class="_blank" style="height: 15px"></div>
                            <p id="cart-box-title">
                                TOTAL :
                            </p>
                            <div class="_blank" style="height: 12px"></div>
                            <?php
                                $cart = $this->cart_m->get();
                                $total = 0;
                                foreach($cart as $c){
                                    $total += $c['amount']*$c['price'];
                                }
                            ?>
                            <p id="cart-box-total">
                                Rp. &nbsp;&nbsp;&nbsp;&nbsp;<?php echo number_format($total, 0, '', '.');?>,-
                            </p>
                            <div class="_blank" style="height: 12px"></div>
                            <div id="cart-box-detail">
                                <ul>
                                    <?php foreach($cart as $c):?>
                                    <li class="cart-box-item"><?php echo sprintf("%02d",$c['amount']);?> - <?php echo $c['name'];?></li>
                                    <?php endforeach;?>
                                </ul>
                            </div>
                            <div class="_blank" style="height: 25px"></div>
                            <p id="cart-box-checkout">
                                <a href="<?php echo base_url();?>cart">CHECKOUT >></a>
                            </p>
                            <div class="_blank" style="height: 15px"></div>
                        </div>
                    </div>
                </div>
                <div id="header-logo">
                    <img src="<?php echo base_url(); ?>images/logo_utama.png" alt="After Idea"/>
                </div>
                <div id="header-menu">
                    <div id="menu-container">
                        <ul id="menu-ul">
                            <li class="menu-li" id="menu-home">
                                <a href="<?php echo base_url(); ?>">
                                    <span class="menu-wrapper">HOME</span>
                                </a>
                            </li>
                            <li class="menu-li" id="menu-products">
                                <a href="<?php echo base_url(); ?>products">
                                    <span class="menu-wrapper">PRODUCTS</span>
                                </a>
                                <ul id="submenu-ul">
                                    <?php foreach($this->products_m->get_categories(0)->result() as $p_cat):?>
                                    <?php 
                                    $submenu = $this->products_m->get_categories($p_cat->products_cat_id);
                                    $count = $submenu->num_rows();
                                    ?>
                                    <li class="submenu-li <?php echo ($count>0)?'has-child':'';?>">
                                        <a href="<?php echo base_url();?>products/cat/<?php echo $p_cat->products_cat_id;?>/<?php echo $p_cat->products_cat_title;?>">
                                            <span class="menu-wrapper"><?php echo strtoupper($p_cat->products_cat_title);?></span>
                                        </a>
                                        <ul id="subsubmenu-ul">
                                            <?php foreach($submenu->result() as $c_cat):?>
                                            <?php 
                                            $subsubmenu = $this->products_m->get_categories($c_cat->products_cat_id);
                                            $count = $subsubmenu->num_rows();
                                            ?>
                                            <li class="subsubmenu-li <?php echo ($count>0)?'has-child':'';?>">
                                                <a href="<?php echo base_url();?>products/cat/<?php echo $c_cat->products_cat_id;?>/<?php echo $c_cat->products_cat_title;?>">
                                                    <span class="menu-wrapper"><?php echo $c_cat->products_cat_title;?></span>
                                                </a>
                                                <ul id="childsubmenu-ul">
                                                    <?php foreach ($subsubmenu->result() as $d_cat): ?>
                                                        <li class="submenu-li">
                                                            <a href="<?php echo base_url(); ?>products/cat/<?php echo $d_cat->products_cat_id; ?>/<?php echo $d_cat->products_cat_title; ?>">
                                                                <span class="menu-wrapper"><?php echo $d_cat->products_cat_title; ?></span>
                                                            </a>
                                                        </li>
                                                    <?php endforeach; ?>
                                                </ul>
                                            </li>
                                            <?php endforeach;?>
                                        </ul>
                                    </li>
                                    <?php endforeach;?>
                                </ul>
                            </li>
                            <li class="menu-li" id="menu-designer">
                                <a href="<?php echo base_url(); ?>designers">
                                    <span class="menu-wrapper">DESIGNER</span>
                                </a>
                            </li>
                            <li class="menu-li" id="menu-faq">
                                <a href="<?php echo base_url();?>faq">
                                    <span class="menu-wrapper">ARTICLE</span>
                                </a>
                            </li>
                            <li class="menu-li" id="menu-contact">
                                <a href="<?php echo base_url();?>contact">
                                    <span class="menu-wrapper">CONTACT</span>
                                </a>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>